﻿using com.guojin.core.io;
using com.guojin.core.io.message;

namespace com.guojin.mj.net.message.game
{
    public class UserTrusteeshipReq : Message
    {
        public static int TYPE = 12;
        public static int ID = 16;

        public int locationIndex; //申请玩家id
        public int trusteeshipState; // 0取消托管  1托管（目前没有申请托管功能，保留接口）

        public void decode(Input _in)
        {
        }

        public void encode(Output _out)
        {
            _out.writeInt(locationIndex);
            _out.writeInt(trusteeshipState);
        }

        public int getMessageId()
        {
            return ID;
        }

        public int getMessageType()
        {
            return TYPE;
        }

        public string toString()
        {
            return string.Format("UserTrusteeshipReq[UserID={0}, trusteeshipState= {1}]", locationIndex,
                trusteeshipState);
        }

        public static UserTrusteeshipReq create(int locationIndex, int trusteeshipState)
        {
            var temp = new UserTrusteeshipReq();
            temp.locationIndex = locationIndex;
            temp.trusteeshipState = trusteeshipState;
            return temp;
        }
    }
}